package com.chenzhou.service;

import com.chenzhou.dao.ProductDAOImpl;
import com.chenzhou.entity.ProductEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductService {

    @Autowired
    private ProductDAOImpl dao;

    public List<ProductEntity> queryAll(){
        return dao.queryAll();
    }

    public ProductEntity queryByID(Integer pid){return dao.queryByID(pid);}

    public int add_product(ProductEntity productEntity){
        return dao.add_product(productEntity);
    }

    public int modify_product(ProductEntity productEntity){
        return dao.update_product(productEntity);
    }

    public int delete_product(Integer pid){
        return dao.delete_product(pid);
    }
}
